gtk4.git
12 years agowayland: ensure the clip region is updated after the window size is updated
Thomas Wood [Tue, 14 May 2013 14:25:30 +0000 (15:25 +0100)]
wayland: ensure the clip region is updated after the window size is updated

https://bugzilla.gnome.org/show_bug.cgi?id=700301

12 years agogtkmenutrackeritem: Simplify the submenu opening API
Jasper St. Pierre [Mon, 13 May 2013 19:52:21 +0000 (15:52 -0400)]
gtkmenutrackeritem: Simplify the submenu opening API

Instead of making clients inspect the submenu action and decide what
to do based upon that, always request the submenu open and let the
tracker decide what to do.

12 years agoAdd some usage docs for the new private copy/paste APIs
Jasper St. Pierre [Mon, 13 May 2013 19:11:41 +0000 (15:11 -0400)]
Add some usage docs for the new private copy/paste APIs

12 years agoadd GtkMenuTrackerItem
Ryan Lortie [Wed, 8 May 2013 12:20:23 +0000 (08:20 -0400)]
add GtkMenuTrackerItem

Add a new class, GtkMenuTrackerItem that represents a menu item, to be
used with GtkMenuTracker.

GtkMenuTracker's insert callback now works in terms of this new type
(instead of passing reference to the model and an index to the item).

GtkMenuShell now handles all of the binding tasks internally, mostly
through the use of property bindings.  Having bindings for the label and
visibility attributes, in partiular, will help with supporting upcoming
extensions to GMenuModel.

GtkModelMenu has been reduced to a helper class that has nothing to do
with GMenuModel.  It represents something closer to an "ideal" API for
GtkMenuItem if we didn't have compatibility concerns (eg: not emitting
"activate" when setting toggle state, no separate subclasses per menu
item type, supporting icons, etc.) Improvements to GtkMenuItem could
eventually shrink the size of this class or remove the need for it
entirely.

Some GtkActionHelper functionality has been duplicated in
GtkMenuTracker, which is suboptimal.  The duplication exists so that
other codebases (such as Unity and gnome-shell) can reuse the
GtkMenuTracker code, whereas GtkActionHelper is very much tied to
GtkWidget.  Supporting binding arbitrary GtkWidgets to actions vs.
supporting the full range of GMenuModel features for menu items turns
out to be two overlapping but not entirely similar problems.  Some of
the duplication (such as roles) can be removed from GtkActionHelper once
Gtk's internal Mac OS menubar support is ported to GtkMenuTracker.

The intent to reuse the code outside of Gtk is also the reason for the
unusual treatment of the enum type introduced in this comment.

This adds no new "public" API to the Gtk library, other than types that
we cannot make private due to GType limitations.

12 years agoaction stuff: Change include style
Ryan Lortie [Thu, 9 May 2013 19:08:02 +0000 (15:08 -0400)]
action stuff: Change include style

The shell wants to transplant our GtkActionObserver/GtkActionObservable
code now as well, so change to ""-style #includes there.

12 years agoaction stuff: Introspection fixes
Jasper St. Pierre [Thu, 9 May 2013 19:28:57 +0000 (15:28 -0400)]
action stuff: Introspection fixes

12 years agoaction stuff: Remove G_GNUC_INTERNAL
Jasper St. Pierre [Mon, 13 May 2013 16:02:24 +0000 (12:02 -0400)]
action stuff: Remove G_GNUC_INTERNAL

12 years agoaction stuff: stop abusing GLib's namespace
Ryan Lortie [Thu, 9 May 2013 18:15:51 +0000 (14:15 -0400)]
action stuff: stop abusing GLib's namespace

Rename our internal GActionMuxer, GActionObserver and GActionObservable
classes and interfaces to have names in our own namespace.

These classes were originally intended for GIO but turned out to be too
special-purpose to be useful there, so we never made them public API but
have just been copying them around (without bothering to properly rename
them).  Now that other people will be copying them out of Gtk, it's even
more important to prevent this namespace abuse from spreading further.

12 years agotests: make GtkMenu test more flexible
Ryan Lortie [Sun, 5 May 2013 21:18:13 +0000 (17:18 -0400)]
tests: make GtkMenu test more flexible

We were using gtk_menu_item_get_label() from a testcase to determine the
label associated with a menu item.  Future changes to GtkModelMenuItem
will cause this to stop working, so try a bit harder to find a label
inside of the item.

12 years agoRevert "Fix .ui.h -> .ui naming of files."
Matthias Clasen [Mon, 13 May 2013 19:45:47 +0000 (15:45 -0400)]
Revert "Fix .ui.h -> .ui naming of files."

This reverts commit 99c7091abe40a0a1a6da4a80f5168e9286c02b4d.

Please, no more touching of POTFILES.in without asking first.
These .ui.h files are really meant to be there.

12 years agoBuild extract-strings tool for build system
Hib Eris [Sat, 11 May 2013 14:57:39 +0000 (16:57 +0200)]
Build extract-strings tool for build system

This fixes cross compiling where build system != host system.

https://bugzilla.gnome.org/show_bug.cgi?id=699690

12 years agoUpdated Norwegian bokmål translation
Kjartan Maraas [Mon, 13 May 2013 12:44:04 +0000 (14:44 +0200)]
Updated Norwegian bokmål translation

12 years agoFix .ui.h -> .ui naming of files.
Kjartan Maraas [Mon, 13 May 2013 12:37:04 +0000 (14:37 +0200)]
Fix .ui.h -> .ui naming of files.

12 years agoAdd a test for dialog placement with csd
Matthias Clasen [Mon, 13 May 2013 10:06:10 +0000 (06:06 -0400)]
Add a test for dialog placement with csd

Taken from
https://bugzilla.gnome.org/show_bug.cgi?id=700056

12 years agoGtkPlacesSidebar: Fixed tooltip capitalization
Joe Pea [Sun, 12 May 2013 20:28:24 +0000 (13:28 -0700)]
GtkPlacesSidebar: Fixed tooltip capitalization

Use sentence capitalization for the tooltip on the file system disk under Devices.
https://bugzilla.gnome.org/show_bug.cgi?id=698933

12 years agoFix accels added after the window was shown not working
Bastien Nocera [Fri, 10 May 2013 14:04:11 +0000 (16:04 +0200)]
Fix accels added after the window was shown not working

GtkApplicationWindow would only update its list of captured accels
when realizing the window. This meant that keyboard shortcuts added
after the window was realised (for example, added by plugins) would
be non-functional.

Solve this by updating our accels every time the accel map changes,
not only when realizing the window.

https://bugzilla.gnome.org/show_bug.cgi?id=700079

12 years agoImprove wording of filechooser context menu
Matthias Clasen [Mon, 13 May 2013 02:25:54 +0000 (22:25 -0400)]
Improve wording of filechooser context menu

Use header captialization, and shorten the labels a bit.
https://bugzilla.gnome.org/show_bug.cgi?id=698361

12 years agoImprove sensitivity handling in filechooser context menu
Matthias Clasen [Mon, 13 May 2013 02:17:15 +0000 (22:17 -0400)]
Improve sensitivity handling in filechooser context menu

Items that act on the selection should not be sensitive if the
selection is empty. This was already the case for the 'Copy file
location' item, but not for the 'Add bookmark' and 'Visit file'
items.
https://bugzilla.gnome.org/show_bug.cgi?id=699104

12 years agoFind tooltip/dnd widget running through container children in inverse order
Carlos Garnacho [Mon, 29 Apr 2013 17:25:21 +0000 (19:25 +0200)]
Find tooltip/dnd widget running through container children in inverse order

Usually, educated GtkContainers' forall() implementation returns children
in an order that's safe for the default draw() implementation in GtkContainer.
So for widgets with some stacking notions (eg. GtkOverlay),
_gtk_widget_find_at_coords() needs to recurse within containers in reverse
order so it finds the topmost widget.

As this function is used in both tooltips and DnD code, this improves behavior
of "floating" widgets wrt those two. This could for example be seen in the
"Transparent" GTK+ demo, where dropping text on the entry results on the text
going to the textview.

https://bugzilla.gnome.org/show_bug.cgi?id=699239

12 years agoTest a few more titlebar things
Matthias Clasen [Mon, 13 May 2013 01:00:06 +0000 (21:00 -0400)]
Test a few more titlebar things

Add tests for fullscreening and disposing with custom titlebar
to testheaderbar.

12 years agocsd: Properly dispose custom titlebars
Matthias Clasen [Mon, 13 May 2013 00:58:48 +0000 (20:58 -0400)]
csd: Properly dispose custom titlebars

gtk_bin_remove can't handle internal children, so we have
to unset the titlebar widget before chaining up in dispose.

https://bugzilla.gnome.org/show_bug.cgi?id=700054

12 years agocsd: Ignore titlebars when hidden
Matthias Clasen [Mon, 13 May 2013 00:53:41 +0000 (20:53 -0400)]
csd: Ignore titlebars when hidden

We were not drawing the content background in the titlebar
area when fullscreen, and were still treating clicks there
as if they were on the titlebar.

12 years agocsd: Manage visibility of custom titlebars
Matthias Clasen [Mon, 13 May 2013 00:47:55 +0000 (20:47 -0400)]
csd: Manage visibility of custom titlebars

We should hide custom titlebars when in fullscreen mode, just
as we do for non-custom titlebars.
https://bugzilla.gnome.org/show_bug.cgi?id=700053

12 years agoDoc: various small fixes
Sébastien Wilmet [Wed, 17 Apr 2013 10:38:44 +0000 (12:38 +0200)]
Doc: various small fixes

https://bugzilla.gnome.org/show_bug.cgi?id=700007

12 years agogtktextchild: replace hard-coded values by a macro
Sébastien Wilmet [Tue, 2 Apr 2013 22:27:50 +0000 (00:27 +0200)]
gtktextchild: replace hard-coded values by a macro

The macro already exists, so it's better to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=700007

12 years agoGtkComboBoxText: Improved GtkBuildable documentation.
Tristan Van Berkom [Sun, 12 May 2013 12:56:40 +0000 (21:56 +0900)]
GtkComboBoxText: Improved GtkBuildable documentation.

Also removed a bogus FIXME comment which might have been true
a long time ago. Clarification: the "domain" attribute specified
in the builder script overrides any domain previously set with
gtk_builder_set_translation_domain(), so the translation of items
here is perfectly correct and does not need to be fixed.

12 years agoUpdated Russian translation
Yuri Myasoedov [Sun, 12 May 2013 08:45:51 +0000 (12:45 +0400)]
Updated Russian translation

12 years agoMake gtk_window_resize work again
Matthias Clasen [Sat, 11 May 2013 23:44:57 +0000 (19:44 -0400)]
Make gtk_window_resize work again

This hunk of code was lost by accident in the previous commit.

12 years agoGtkWindow: default size is only for initial map
Matthias Clasen [Sat, 11 May 2013 22:45:27 +0000 (18:45 -0400)]
GtkWindow: default size is only for initial map

Bring back need_default_size. We need it to preserve this
documented behavior:

The default size of a window only affects the first time a window is
shown; if a window is hidden and re-shown, it will remember the size
it had prior to hiding, rather than using the default size.

With this patch, all of the window sizing tests in
gtk/tests/window pass again.

12 years agowidget: make gtk_widget_compute_size_for_orientation() static
Benjamin Otte [Sat, 11 May 2013 13:11:53 +0000 (15:11 +0200)]
widget: make gtk_widget_compute_size_for_orientation() static

It's not used anywhere outside of gtksizerequest.c anymore.

12 years agoAPI: Don't export gtk_widget_preferred_size_and_baseline()
Benjamin Otte [Sat, 11 May 2013 12:29:29 +0000 (14:29 +0200)]
API: Don't export gtk_widget_preferred_size_and_baseline()

gtk_widget_preferred_size() is only useful if you want to quickly port a
widget from GTK2 sizing code to GTK3 but does not properly work with
height-for-width as used in GTK. So we don't want to encourage people to
use it. In particular we want people to convert to height-for-width
before adding baseline support to their widgets.

12 years agoquartz: Remove unused variable
Benjamin Otte [Sat, 11 May 2013 11:40:38 +0000 (13:40 +0200)]
quartz: Remove unused variable

12 years agoFix typo in 6115961175
John Ralls [Sat, 11 May 2013 00:25:11 +0000 (17:25 -0700)]
Fix typo in 6115961175

12 years agoRemove framework initialization code
John Ralls [Sat, 11 May 2013 00:21:27 +0000 (17:21 -0700)]
Remove framework initialization code

This is left over from an old effort to bundle gtk and its dependencies
into a Mac OS X Framework. The effort was more or less successful but
proved difficult to maintain and impractical to use because gtk programs
don't use the special Framework include syntax.

12 years agoAdd more window-size related tests
Matthias Clasen [Fri, 10 May 2013 17:53:31 +0000 (13:53 -0400)]
Add more window-size related tests

12 years agoGtkBookmarksManager: Only save if we have data to save
Colin Walters [Thu, 9 May 2013 20:48:38 +0000 (16:48 -0400)]
GtkBookmarksManager: Only save if we have data to save

Otherwise we write an empty file, which is lame.

12 years agoGtkBookmarksManager: Ensure parent directory exists when saving
Colin Walters [Thu, 9 May 2013 20:48:03 +0000 (16:48 -0400)]
GtkBookmarksManager: Ensure parent directory exists when saving

Otherwise we fail when the user doesn't have ~/.config yet.

12 years agowidget: Remove unused variable
Benjamin Otte [Thu, 9 May 2013 17:05:43 +0000 (19:05 +0200)]
widget: Remove unused variable

12 years agobuild: remove --disable-rebuilds
Benjamin Otte [Thu, 9 May 2013 16:57:34 +0000 (18:57 +0200)]
build: remove --disable-rebuilds

It's unused and was only useful when perl wasn't installed. But perl is
a dependency of glib these days, so it's useless.

12 years agoAdd --enable-installed-tests, use it for reftests
Colin Walters [Thu, 9 May 2013 16:38:08 +0000 (18:38 +0200)]
Add --enable-installed-tests, use it for reftests

See https://live.gnome.org/GnomeGoals/InstalledTests

https://bugzilla.gnome.org/show_bug.cgi?id=699601

12 years agoreftests: Automatically recurse into directories
Benjamin Otte [Thu, 9 May 2013 16:34:49 +0000 (18:34 +0200)]
reftests: Automatically recurse into directories

12 years agoconfigure: Don't check for indent
Benjamin Otte [Thu, 9 May 2013 15:06:16 +0000 (17:06 +0200)]
configure: Don't check for indent

indent was used in genmarshal.pl, which was removed in 2002 when gobject
was created.

12 years agoreftests: Add a --directory/-d option
Colin Walters [Thu, 9 May 2013 14:17:32 +0000 (16:17 +0200)]
reftests: Add a --directory/-d option

This sets the directory we chdir() to, so we can use relative filenames
in ui files.

Some properties like to take filenames...

12 years agoreftests: Split out shell scripts from tests
Colin Walters [Tue, 7 May 2013 12:52:35 +0000 (14:52 +0200)]
reftests: Split out shell scripts from tests

They are just utilities to create tests, don't dump them in with the
tests.

This is in preparation for installed tests.

12 years agoreftests: Use $(NULL) in the Makefile
Colin Walters [Tue, 7 May 2013 12:48:36 +0000 (14:48 +0200)]
reftests: Use $(NULL) in the Makefile

12 years agoRemove gtk_widget_size_allocate from gtk_menu_popup_for_device
Matthias Clasen [Thu, 9 May 2013 16:06:05 +0000 (12:06 -0400)]
Remove gtk_widget_size_allocate from gtk_menu_popup_for_device

GtkMenu calls gtk_widget_size_allocate on its GtkWindow during
gtk_menu_popup_for_device if the menu has not been realised. This can cause the
allocation of the GtkWindow and the size of the GdkWindow to become out of sync
because a top level GtkWindow does not attempt to re-size the GdkWindow when
its allocation is set.
https://bugzilla.gnome.org/show_bug.cgi?id=695120

12 years agoGtkCheckMenuItem: remove an unused boolean field
Ryan Lortie [Wed, 8 May 2013 12:15:40 +0000 (08:15 -0400)]
GtkCheckMenuItem: remove an unused boolean field

always_show_toggle was always set to TRUE in _init() and never changed
from anywhere else.  Remove it and remove the if() statements based on
it.

https://bugzilla.gnome.org/show_bug.cgi?id=699929

12 years agoFix a typo
Matthias Clasen [Thu, 9 May 2013 16:02:59 +0000 (12:02 -0400)]
Fix a typo

Pointed out in bug
https://bugzilla.gnome.org/show_bug.cgi?id=698051

12 years agoprinting: Don't crash when printer-state-message not provided
Marek Kasik [Mon, 6 May 2013 11:43:18 +0000 (13:43 +0200)]
printing: Don't crash when printer-state-message not provided

Check whether "printer-state-message" was returned before its
usage.

https://bugzilla.gnome.org/show_bug.cgi?id=699750

12 years agolabel: fix return value type for _draw()
Stefan Sauer [Wed, 8 May 2013 20:00:30 +0000 (22:00 +0200)]
label: fix return value type for _draw()

Change from gint to gboolean.

12 years agoMake key themes work again
Matthias Clasen [Wed, 8 May 2013 14:19:08 +0000 (10:19 -0400)]
Make key themes work again

This was inadvertedly broken in commit
44ba5d253f5bbda2d5a42c58218ad2aa318256f4.
Thanks to Matthew Francis for tracking this down and providing
a fix in https://bugzilla.gnome.org/show_bug.cgi?id=699901

12 years agogdkwindow: Don't enforce a native window for a custom visual
Alexander Larsson [Wed, 8 May 2013 13:57:58 +0000 (15:57 +0200)]
gdkwindow: Don't enforce a native window for a custom visual

In the ancient X days you could have Xservers that had multiple active windows, like
one truecolor and one 8bit palette. Then most apps ran in 8bpp but a single window
would use truecolor. This is done by specifying different visuals for the windows.

To make this work we ensured that a window with a visual different from its parent
gets a native subwindow, so that X can tell the hardware to do its magic.

These days the only real time we get two different visual is when one is a rgba visual
and the other is not. So, the code to check this doesn't really do anything but
get in the way when someone accidentally manages to not get a rgba visual on
a child window (see bb7054b508bfe41eb3e7f27496d4c2eb3a2b2f7a). So, to avoid
such errors we just remove the "different visual than parent" check.

12 years agooverlay/paned: Ensure we set the right visual on windows
Alexander Larsson [Wed, 8 May 2013 13:51:00 +0000 (15:51 +0200)]
overlay/paned: Ensure we set the right visual on windows

This was always "needed", but the problems with not doing it
now are worse, since any CSD window will have a nonstandard
rgba visual.

12 years agol10n: Update Japanese translation
Jiro Matsuzawa [Wed, 8 May 2013 12:16:47 +0000 (21:16 +0900)]
l10n: Update Japanese translation

12 years agoRemove abi checking scripts (2)
Rico Tzschichholz [Tue, 7 May 2013 15:34:32 +0000 (17:34 +0200)]
Remove abi checking scripts (2)

In addition to 019ad96479a9bafbf2948aa240dd57e2229f5985

12 years agoGtkPixelCache: Free cache if not used in 20 seconds
Alexander Larsson [Tue, 7 May 2013 12:27:17 +0000 (14:27 +0200)]
GtkPixelCache: Free cache if not used in 20 seconds

No need to keep a performance enhancing cache around if its not
actually in use.

12 years agogdkwindow: Expose all native windows
Alexander Larsson [Tue, 7 May 2013 09:46:50 +0000 (11:46 +0200)]
gdkwindow: Expose all native windows

We need to send exposes for all native windows, even the ones
without an exposure mask set, because otherwise non-native
children of the native window with an exposure mask will
not be drawn.

12 years agoGtkStack: Fix double-draw in crossfade
Alexander Larsson [Tue, 7 May 2013 07:28:30 +0000 (09:28 +0200)]
GtkStack: Fix double-draw in crossfade

We should only draw the cross-fade on the bin window, not doing this
was causing us to draw it multiple times using ADD which resulted
in weird colors.

12 years agogdkwindow: Avoid some unnecessary typechecks
Alexander Larsson [Fri, 3 May 2013 08:44:44 +0000 (10:44 +0200)]
gdkwindow: Avoid some unnecessary typechecks

This removes the typechecks in GDK_WINDOW_TYPE and GDK_WINDOW_DESTROYED. These
are only used internally in gdkwindow.c and gdkdisplay.c anyway,  and these
functions check for typesafety of arguments on function entry.

12 years agoGtkWidget: Use gdk_window_get_children_for_user_data
Alexander Larsson [Fri, 3 May 2013 08:42:40 +0000 (10:42 +0200)]
GtkWidget: Use gdk_window_get_children_for_user_data

This makes iterating over the children a lot faster, as we're
not doing lots of intra-library calls and type checks. We're still
in some sence O(n^2) since we iterate over each child window for each
widget, but the profiles look much better.

12 years agoAdd gdk_window_get_children_with_user_data
Alexander Larsson [Fri, 3 May 2013 08:39:24 +0000 (10:39 +0200)]
Add gdk_window_get_children_with_user_data

This function returns all the children that has a specific user_data set.
This is used a lot in the new GtkWidget drawing code and doing
it this way is faster than getting every child and calling get_user_data
on each (which was a non-neglible part of the profiles). Additionally it
also allows use to use some kind of hashtable to make this operation even
faster if needed in the future.

12 years agoGtkTreeView: port to PixelCache
Alexander Larsson [Tue, 30 Apr 2013 19:34:22 +0000 (21:34 +0200)]
GtkTreeView: port to PixelCache

We register an invalidate handler on the bin window to get told
of child widget invalidations, although we manually need to discard
invalidates from the scroll operation.

Additionally we invalidate all of the pixel cache whenever
the TreeView itself is queue_draw()n to handle e.g. style (bg)
changes, or changes due to model changes causing queue_draw() in
the tree view.

12 years agoMake GtkViewport use GtkPixelCache
Alexander Larsson [Sat, 20 Apr 2013 23:54:05 +0000 (01:54 +0200)]
Make GtkViewport use GtkPixelCache

Since gdk_window_move() no longer uses XCopyArea all scrolling
now re-renders everything in the window. To get performance
back we use a GtkPixelCache to store already drawn children,
and we when we expose the viewport we just blit the
offscreen to the right place.

12 years agoGtkPixelCache: Add debug feature to track redraws
Alexander Larsson [Thu, 2 May 2013 09:47:06 +0000 (11:47 +0200)]
GtkPixelCache: Add debug feature to track redraws

Each time we redraw we tint it in a different color so that
you can see which regions are redrawn.

12 years agoAdd GtkPixelCache
Alexander Larsson [Thu, 2 May 2013 14:23:42 +0000 (16:23 +0200)]
Add GtkPixelCache

GtkPixelCache is a helper utility that lets you implement
faster scrolling of a viewport of a canvas by using an
offscreen pixmap cache.

You call _gtk_pixel_cache_draw with a callback function that
does the drawing, and additionally you specify the size and the
position of the viewport in the widget, and the position and size
of the canvas wrt the viewport. The callback will be called to
draw on an offscreen surface, and the surface will be drawn
on the window. The next time you do the same, any already drawn
pieces of the surface are re-used from the offscreen and need
not be rendered again.

If things inside the canvas change you need to call
_gtk_pixel_cache_invalidate to tell the cache about this.

Some other details:

* The offscreen surface is generally a bit larger than
  the viewport, so scrolling a small amount can often
  be done without redrawing children.
* If the canvas is not larger than the viewport no
  offscreen surface is used.

GtkPixelCache: Make sure we always copy using SOURCE

We were using OVER for the first copy (from source to group surface.

GtkPixelCache: Fix x/y typos

GtkPixelCache: Allow NULL for invalidate region

gtkpixelcache: Use CONTENT_COLOR for solid bg windows

12 years agoGtkWidget: Add a vfunc for queue_draw_region
Alexander Larsson [Thu, 2 May 2013 09:08:10 +0000 (11:08 +0200)]
GtkWidget: Add a vfunc for queue_draw_region

Since widgets now cache drawn state we allow them to override
queue_draw_region to detect when some region of the widget
should be redrawn. For instance, if a widget draws the
background color in a pixel cache we will need to invalidate
that when the style context changes which queues a repaint.

12 years agoAdd gdk_window_set_invalidate_handler
Alexander Larsson [Sat, 20 Apr 2013 23:27:07 +0000 (01:27 +0200)]
Add gdk_window_set_invalidate_handler

This lets you register callbacks for when child widgets invalidate
areas of the window read it and/or change it.

For instance, this lets you do rendering effects and keeping offscreen
caches uptodate.

12 years agowayland: Don't use double buffers for wayland when not needed
Alexander Larsson [Mon, 29 Apr 2013 19:49:12 +0000 (21:49 +0200)]
wayland: Don't use double buffers for wayland when not needed

If we got the release event for the last buffer then we're
fine with writing directly to the window surface, as wayland
will not be looing at it. This saves us from allocating
and copying more data.

12 years agogdkwindow: Make GdkPaintable normal GdkWindowImpl vfuncs
Alexander Larsson [Mon, 29 Apr 2013 16:40:10 +0000 (18:40 +0200)]
gdkwindow: Make GdkPaintable normal GdkWindowImpl vfuncs

There is no need for this to be a separate interface, its just looking
weird.

12 years agogdkwindow: Change how paints work
Alexander Larsson [Mon, 29 Apr 2013 14:25:55 +0000 (16:25 +0200)]
gdkwindow: Change how paints work

First of all, we now only do paints on native windows, as there is
really no reason anymore to do it for subwindows. Secondly, we
keep track of the paints even for GtkPaintable windows, but for
that case we don't create the offscreen surface, but rather
assume the windowing system does the backing store.

12 years agoGtkWindow: Move cairo_save/restore from marshaller
Alexander Larsson [Thu, 25 Apr 2013 12:00:18 +0000 (14:00 +0200)]
GtkWindow: Move cairo_save/restore from marshaller

We do the save/restore when emitting ::draw rather than in a custom
marshaller, as this saves an extra stack frame, which is helpfull now
that we do painting fully recursive. This is also likely to save a few
cycles.

12 years agogdkframeclock: Loop the layout phase if needed
Alexander Larsson [Wed, 24 Apr 2013 20:21:06 +0000 (22:21 +0200)]
gdkframeclock: Loop the layout phase if needed

In the case where the layout phase queued a layout we don't
want to progress to the paint phase with invalid allocations, so
we loop the layout. This shouldn't normally happen, but it may
happen in some edge cases like if user/wm resizes clash with
natural window size changes from a gtk widget. This should not
generally loop though, so we detect this after 4 cycles and
print a warning.

This was detected because of an issue in GtkWindow where it
seems to incorrectly handle the case of a user interactive resize.
It seems gtk_window_move_resize() believes that configure_request_size_changed
changed due to hitting some corner case so it calls
gtk_widget_queue_resize_no_redraw(), marking the window as need_alloc
after the layout phase. This commit fixes the issue, but we should
also look into if we can fix that.

12 years agogdkwindow: Simplify invalidation
Alexander Larsson [Fri, 19 Apr 2013 15:40:58 +0000 (17:40 +0200)]
gdkwindow: Simplify invalidation

Now that all windows are non-opaque we can simplify the invalidation
a lot. There is no need to clip the invalidate area to child regions,
because we will always redraw everything under all the children.
We only have to handle native childen specially.

12 years agogdkwindow: Remove implicit paints
Alexander Larsson [Wed, 17 Apr 2013 21:06:07 +0000 (23:06 +0200)]
gdkwindow: Remove implicit paints

We now only do one expose event per native window, so there will
only be one begin/end_paint() call. This means all the work with
implicit paints to combine the paints on a single double buffer
surface is unnecessary, so we can just delete it.

12 years agoOnly handle exposes on native window, propagate to children via draw()
Alexander Larsson [Wed, 17 Apr 2013 18:55:26 +0000 (20:55 +0200)]
Only handle exposes on native window, propagate to children via draw()

We now consider non-native windows non-opaque, which means any invalid
area in a subwindow will also be invalid all the way up to the nearest
native windows. We take advantage of this by ignoring all expose events
on non-native windows (which typically means just the toplevel) and instead
propagating down the draw() calls to children directly via
gtk_container_propagate_draw.

This is nice as it means we always draw widgets the same way, and it
will let us do some interesting ways in the future.

We also clean up the GtkWidget opacity handling as we can now always
rely on the draing happening via cairo.

We can't really just draw by walking down the widget hierarchy, as
this doesn't get the clipping right (so e.g. widgets doing cairo_paint
may draw outside the expected gdkwindow subarea) nor does it let
us paint window backgrounds.

So, we now do multiple draws for each widget, once for each GdkWindow,
although we still do it on the same base cairo_t that we get for the
toplevel native window. The difference is only the clipping, the rendering
order, and which other widgets we propagate into.

We also collect all the windows of a widget so we can expose them inside
the same opacity group if needed.

NOTE: This change neuters gtk_widget_set_double_buffered for
widgets without native windows. Its impossible to disable
the double buffering in this model.

12 years agogdkwindow: Remove ancient USE_BACKING_STORE define
Alexander Larsson [Wed, 17 Apr 2013 15:10:18 +0000 (17:10 +0200)]
gdkwindow: Remove ancient USE_BACKING_STORE define

This is always set anyway.

12 years agogdkwindow: Simplify clip region calculations
Alexander Larsson [Wed, 17 Apr 2013 15:05:49 +0000 (17:05 +0200)]
gdkwindow: Simplify clip region calculations

Since we no longer make overlapping siblings affect clip_region we
can further simplify the clip region calculation and updating.

12 years agogdkwindow: Simplify clip region handling
Alexander Larsson [Wed, 17 Apr 2013 14:36:52 +0000 (16:36 +0200)]
gdkwindow: Simplify clip region handling

Since we dropped the move region optimization there is really no need
to try carefully keep track of opaque non-overlapped regions, as we
don't use this information to trigger the optimization anymore.

So, by assuming that all windows are non-opaque we can vastly simplify
the clip region stuff. First of all, we don't need clip_region_with_children,
as each window will need to draw under all children anyway. Secondly, we
don't remove overlapping sibling areas from clip_region, as these are
all non-opaque anyway and we need to draw under them

Finally, we don't need to track the layered region anymore as its
essentially unused. The few times something like it is needed we can
compute it explicitly.

For the case of native children of widgets we may cause a repaint
under native windows that are guaranteed to be opaque, but these
will be clipped by the native child anyway.

12 years agogdkwindow: Remove translate vfunc
Alexander Larsson [Wed, 17 Apr 2013 12:15:51 +0000 (14:15 +0200)]
gdkwindow: Remove translate vfunc

This is not used anymore

12 years agogdkwindow: Remove outstanding_moves stuff
Alexander Larsson [Wed, 17 Apr 2013 12:02:32 +0000 (14:02 +0200)]
gdkwindow: Remove outstanding_moves stuff

Since we now never move regions directly on the window we can
remove all the stuff that track outstanding moves and flushes then.

12 years agogdk: Don't ever do copies from the window
Alexander Larsson [Wed, 17 Apr 2013 11:13:46 +0000 (13:13 +0200)]
gdk: Don't ever do copies from the window

This basically neuters gdk_window_move_region, gdk_window_scroll
and gdk_window_move_resize, in that they now never copy any bits but
just invalidate the source and destination regions. This is a performance
loss, but the hope is that the simplifications it later allows will let
us recover this performance loss (which mainly affects scrolling).

12 years agoAdd more test cases
Matthias Clasen [Tue, 7 May 2013 12:48:01 +0000 (08:48 -0400)]
Add more test cases

These are taken from
https://bugzilla.gnome.org/show_bug.cgi?id=696882

12 years agoimcontexts: Include config.h first
Benjamin Otte [Tue, 7 May 2013 12:03:52 +0000 (14:03 +0200)]
imcontexts: Include config.h first

12 years agoreftests: Make window size not influence test
Benjamin Otte [Tue, 7 May 2013 11:46:51 +0000 (13:46 +0200)]
reftests: Make window size not influence test

The test is supposed to definitely wrap, make sure it does.

12 years agocheckbutton: Implement height-for-width
Benjamin Otte [Tue, 7 May 2013 11:46:15 +0000 (13:46 +0200)]
checkbutton: Implement height-for-width

12 years agocheckbutton: Split out a common function
Benjamin Otte [Tue, 7 May 2013 11:18:00 +0000 (13:18 +0200)]
checkbutton: Split out a common function

Makes size request / allocation code easier to understand.

12 years agoGtkPlacesSidebar: Fix an uninitialized variable in the error code path
Kalev Lember [Tue, 7 May 2013 11:41:21 +0000 (13:41 +0200)]
GtkPlacesSidebar: Fix an uninitialized variable in the error code path

Initialize it to NULL early so that we won't try to free an
uninitialized variable when handling an error.

12 years agogtksizegroup: Add explicit braces to avoid dangling else
Kalev Lember [Tue, 2 Apr 2013 22:35:27 +0000 (00:35 +0200)]
gtksizegroup: Add explicit braces to avoid dangling else

Otherwise the else after the for loop becomes attached to the wrong if.

12 years agoAdd a testcase for the dnd window breakage
Matthias Clasen [Tue, 7 May 2013 10:11:42 +0000 (06:11 -0400)]
Add a testcase for the dnd window breakage

12 years agoRemove abi checking scripts
Matthias Clasen [Tue, 7 May 2013 10:00:13 +0000 (06:00 -0400)]
Remove abi checking scripts

The exported symbols are now controlled explicitly from the headers,
no need to double-check.

12 years agoUpdated Hebrew translation.
Yaron Shahrabani [Tue, 7 May 2013 08:25:25 +0000 (11:25 +0300)]
Updated Hebrew translation.

12 years agoGtkEventBox: Correctly handle height for width
Alexander Larsson [Mon, 6 May 2013 15:48:46 +0000 (17:48 +0200)]
GtkEventBox: Correctly handle height for width

We need to pass on the width to the child.

https://bugzilla.gnome.org/show_bug.cgi?id=699140

12 years agocss shadow: Add extra slop to the blur clipping
Alexander Larsson [Mon, 6 May 2013 14:05:08 +0000 (16:05 +0200)]
css shadow: Add extra slop to the blur clipping

Turns out our blurring function isn't very nice, it has a lot
of energy past the blur radius, so clipping at exactly the
blur radius causes ugly gradient stops. This just adds 4
extra pixels of slop, which makes this better in most cases.

12 years agocss shadows: Split up rendering of shadows
Alexander Larsson [Mon, 6 May 2013 11:06:13 +0000 (13:06 +0200)]
css shadows: Split up rendering of shadows

We split up the rendering of blurred shadows into 9 parts, the
corners, the sides and the rest. This lets us only blur the "blurry"
part, and it lets us completely skip blurry parts that are fully
clipped.

12 years agocss shadows: Exit early if clip is empty
Alexander Larsson [Mon, 6 May 2013 10:34:09 +0000 (12:34 +0200)]
css shadows: Exit early if clip is empty

12 years agoGtkCssShadowValue: Break out the shadow rendering code
Alexander Larsson [Mon, 6 May 2013 07:48:10 +0000 (09:48 +0200)]
GtkCssShadowValue: Break out the shadow rendering code

This makes it easier to call it multiple times which we
want to do later.

12 years agocss: Clip outset box-shadow to outside of box
Alexander Larsson [Fri, 3 May 2013 10:50:18 +0000 (12:50 +0200)]
css: Clip outset box-shadow to outside of box

As per css3-background 7.2. Drop Shadows: the ‘box-shadow’ property:

  An outer box-shadow casts a shadow as if the border-box of the element
  were opaque. The shadow is drawn outside the border edge only: it
  is clipped inside the border-box of the element.

Also verified vs firefox behaviour.

12 years agogtksettings: Fix loading of uint settings
Stef Walter [Mon, 6 May 2013 09:03:21 +0000 (11:03 +0200)]
gtksettings: Fix loading of uint settings

https://bugzilla.gnome.org/show_bug.cgi?id=699739

12 years agoRemove regex-based export control
Matthias Clasen [Sun, 5 May 2013 18:27:25 +0000 (14:27 -0400)]
Remove regex-based export control

All export control is now happening through annotations
in the headers.

12 years agoAdd visibility flags in gtk/a11y
Matthias Clasen [Sun, 5 May 2013 18:24:26 +0000 (14:24 -0400)]
Add visibility flags in gtk/a11y